package com.snake.user.web.listener;

import com.snake.context.ComponentContext;
import com.snake.user.sql.DBConnectionManager;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Optional;

/**
 * @author yangxs
 */
@Deprecated
public class DBConnectionInitializerListener implements ServletContextListener {


    @Override
    public void contextInitialized(ServletContextEvent sce) {
        ServletContext servletContext = sce.getServletContext();
        initDataSourceByJNDI(servletContext);
    }

    private void initDataSourceByJNDI(ServletContext servletContext) {

    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {

    }
}
